/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model.Construction.Habitation;

import Model.Construction.Batiment;
import Model.Ville;

/**
 *
 * @author light
 */
public abstract class Habitation extends Batiment {

    protected int capacitePopulation;

    public Habitation(int tx, int ty, Ville v, int capaPop, int prix) {
        super(tx, ty, v, prix);
        capacitePopulation = capaPop;
    }

    @Override
    public void ajoutAVille(int x, int y) {
        super.ajoutAVille(x, y);
        ville.addPopulation(capacitePopulation);
    }

    @Override
    public String getInfo() {
        String s1 = super.getInfo();
        String s2 = "Capacite : " + capacitePopulation + "\n";
        return (s1 + s2);
    }

    @Override
    public void destruction() {
        super.destruction();
        ville.removePopulation(capacitePopulation);
    }
}
